let ID = window.location.href.split('=')[1]
// 获取歌单详情
$.get(`http://192.168.5.120:8089/playlist/detail?id=${ID}`, res => {
	// console.log(res.playlist);
	$('.Songlist-display').append(

		`<div class="Songlist-display-left">
			<img src="${res.playlist.coverImgUrl}" alt="" />
		</div>
		<div class="Songlist-display-right">
			<div class="Songlist-right-top">${res.playlist.name}</div>
			<div class="Songlist-right-bottom">
				<div class="avatar"> <img src="${res.playlist.creator.avatarUrl
		}"></img> </div>
				<div class="nickname">${res.playlist
			.creator.nickname}</div>
			</div>
		</div>`)
	$('.Song-bg').css(`background-image`, `url(${res.playlist.coverImgUrl})`)
})
// 获取歌单的歌曲
$.get(`http://192.168.5.120:8089/playlist/track/all?id=${ID}&limit=10`, res => {
	// console.log(res);
	$.each(res.songs, (index, item) => {

		$('.Song-list-box').append(`
		<div class="Song-list w">
			<div class="SongNumber">
				${index + 1}
			</div>
			<!-- 歌曲 -->
			<a href="Songdetails.html?id=${item.id}">
			<div class="Song">
				<!-- 歌曲名 -->
				<div class="Songname">
					${item.name}
				</div>
				<!-- 歌手名 -->
				<div class="Singername">
					${item.ar[0].name}
				</div>
			</div>
			
			<!-- 右边的播放健 -->
			<div class="play-btn">

			</div>
			</a>
		</div>
			`)
	})

})
